package com.neusoft.elmboot.service;
import java.math.BigDecimal;
import java.util.List;



import com.neusoft.elmboot.po.VirtualWallet;
import com.neusoft.elmboot.po.VirtualWalletTrans;

public interface VirtualWalletService {
    // 根据钱包ID获取虚拟钱包对象
    public VirtualWallet getVirtualWallet(Long walletId);

    // 根据钱包ID获取钱包余额
    public BigDecimal getBalance(Long walletId);

    // 从钱包中扣除指定金额
    public void debit(Long walletId, BigDecimal amount) ;

    // 向钱包中增加指定金额
    public void credit(Long walletId, BigDecimal amount);

    // 解冻钱包中的金额
    public void unfreeze(Long walletId, BigDecimal amount);

    // 实现钱包之间的转账操作
    public void transfer(Long fromWalletId, Long toWalletId, BigDecimal amount);

    // 实现钱包之间的转账操作2
    public void transfer(Long fromWalletId, Long toWalletId, BigDecimal amount,Integer repaymentDeadline);

    // 解冻交易
    public void confirm(Long transactionId);

    // 充值
    public void deposit(Long walletId, BigDecimal amount);

    // 创建虚拟钱包
    public int createVirtualWallet(String userId);

    //根据用户ID获取虚拟钱包对象
    public VirtualWallet getVirtualWalletByUserId(String userId);

    //列举用户的交易流水
    public List<VirtualWalletTrans> listTransactions(Long walletId);

    // 向钱包中增加透支金额
    public void increaseOverdraftAmount(Long walletId, BigDecimal amount);

    // 向钱包中增加透支金额(带利息)
    public void increaseOverdraftAmount(Long walletId, BigDecimal amount,Integer repaymentDeadline);

    //向钱包中减少透支金额
    public void decreaseOverdraftAmount(Long walletId, BigDecimal amount);

    //提现
    public void withdraw(Long walletId, BigDecimal amount);

}
